<%@ page contentType="text/html; charset=UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "file:////Users/do/code/userlibs/DTD/xhtml1-strict.dtd">
<%
	String errorMsg = request.getParameter("login_error");
	String msgBody = null;
	if (errorMsg != null && errorMsg.length() > 0) {
		if (errorMsg.lastIndexOf("userName_not_found") > 0) {
			msgBody = "The user name is not exsited!";
		}
	}
%>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<script type="text/javascript">
	var debug = true;
	if ($('errorMsg_informer')) {
		var errorMsg = <%=msgBody%>;
	}
	if (debug) {
		if ($('userName')) {
			$('userName').value="admin";
		}
		if ($('password')) {
			$('password').value="888888";
		}
		if ($('j_captcha_response')) {
			$('j_captcha_response').value="8888";
		}
		if ($('captcha_img')) {
			$('captcha_img').src += "/randomImage.jsp?Rand=8888.001";
		}
	} else {
		if ($('captcha_img')) {
			$('captcha_img').src += "/randomImage.jsp?Rand="+Math.random()*10000;
		}
	}

	document.body.addEvent('keydown', function(event){
		if (event.keyCode == 13) {
			if ($('loginForm')) {
				$('loginForm').submit();
			}
		}
	});
	
	</script>
</head>

<body>

<form id="loginForm" action="<%=request.getContextPath()%>/j_spring_security_check" method="post">
			<p>
			用户：<input type="text" id="userName" name="j_username" class="input"></input>
			</p>
			<p>
			密码：<input type="password" id="password" name="j_password" class="input"></input>
			</p>
			<p>
			验证：<input type="text" id="j_captcha_response" name="j_captcha_response" class="input"/>					        
			<img id="captcha_img" src='<%=request.getContextPath()%>' />
			</p>
			<div id="errorMsg_informer" ></div>
			
</form>



</body>
</html>
